<?php include template("header");?>
<style>
.action {padding: 30px;}
#simplemodal-overlay {background-color:#000;}
#simplemodal-container {background-color:#fff; border:1px solid #444; padding:22px;}
</style>
<script>
$(document).ready(function(){
	$('#sendwhat').click(function(){$('#contenttosend').modal({overlayClose:true})});
})
</script>
<div id="contenttosend" style="display: none">
	<?php echo $mess; ?><h1 style="color: #a72f3a"><a href="/team.php?id=<?php echo $team['id']; ?>"><?php echo $city['name']; ?>: <?php echo $team['title']; ?></a></h1><?php echo $content; ?>
</div>
<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="send2group">
	<div id="content" class="send2group clear">
        <div class="clear box">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head"><div id="address_book"></div><h2 style="padding-left: 0px;">Gửi đến bạn bè</h2><a id="sendwhat" href="javascript:">&nbsp;>><?php echo $INI['system']['sitename']; ?> gửi gì đến bạn bè của Bạn?</a></div>
                <div id="deal-intro_send2group"><h1><?php echo $city['name']; ?>: <?php echo $team['title']; ?></h1></div>
                <div class="sect">
                	<form id="send2group-form" action="#result" name="send2group" method="post" class="validator">
                        <div class="field email">
                            <label for="email-address">Email</label>
                            <input type="text" size="30" name="email" id="send2group-email-address" class="f-input" require="true" datatype="email|ajax" url="<?php echo WEB_ROOT; ?>/ajax/validator.php" vname="email" msg="Email incorrect format | Email has already been registered" />
                        </div>
                        <div class="field password">
                            <label for="password">Mật khẩu</label>
                            <input type="password" size="30" name="password" id="send2group-password" class="f-input" require="true"  datatype="require" msg="chưa nhập mật khẩu" />
                        </div>  
                        <span class="hint"><label><img alt="" src="../static/img/lock.gif"> Hệ thống không lưu thông tin này</label></span>
                        <div style="margin-left:94px;">
							<img alt="" src="../static/css/i/mail_support.gif">                        	
                        </div>
                        <div class="action">
                            <input type="submit" value="Trích xuất địa chỉ" name="submit" id="grab-submit" class="formbutton"/>
                        </div>                                    		
                	</form>
                	<div id="result"><a name="result"></a>
                	<?php if(isset($errmsg) && isset($_POST['email'])){?><?php echo $errmsg; ?><?php }?>
                	<?php if(!empty($contactlist)){?><br>
                	<form action="/account/send2group.php?action=send&id=<?php echo $team['id']; ?>" name="list" method="post">
                	<div id="note" style="text-align: center;">
                		<h1>Bạn có <?php echo count($contactlist); ?> bạn bè trong sổ địa chỉ</h1>
                		<input type="submit" value="Đồng ý, gửi" class="formbutton">
                		<input type="button" value="Hủy" onclick="location.href='../index.php'" class="formbutton">
                		<input type="hidden" name="sender" value="<?php echo $_POST['email']; ?>">
                	</div>
	                	<table style="width: 97%" id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
	                	<tr class="forum_title_tr"><th>#</th><th>Nick name</th><th>Địa chỉ Email</th></tr>
						<?php if(is_array($contactlist)){foreach($contactlist AS $contact=>$con) { ?>
							<tr <?php echo $i%2?'':'class="alt"'; ?> id="team-list-id-<?php echo ++$i; ?>">
								<td width="10px"><input style="font-size: 18px;" value="<?php echo $con->email .':::'.$con->name; ?>"  type="checkbox" name="check[]" id="check" checked="checked"></td>
								<td width="200px">
									<label><?php echo $con->name; ?></label>
								</td>
								<td>
									<label><?php echo $con->email; ?></label>
								</td>
							</tr>
						<?php }}?>
						</table>
					</form>
					<?php }?>
					</div>
                </div>
            </div>
            <div class="box-bottom"></div>
        </div>
	</div>
</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->
<?php include template("footer");?>
